from sqlalchemy import Column, Integer, String, DateTime, Text
from datetime import datetime

from app.db.base_class import Base


class VideoContent(Base):
    __tablename__ = "video_contents"

    id = Column(Integer, primary_key=True, index=True)
    url = Column(String, index=True, nullable=False)  # 原始视频链接
    platform = Column(String, nullable=False)  # 平台名称 (douyin, kuaishou, xiaohongshu)
    title = Column(Text)  # 视频标题
    description = Column(Text)  # 视频描述
    author = Column(String)  # 作者名称
    tags = Column(Text)  # 标签，JSON格式存储
    publish_time = Column(String)  # 发布时间
    created_at = Column(DateTime, default=datetime.utcnow)  # 记录创建时间